
import axios from 'axios';

const instance = axios.create({
  baseURL: 'http://localhost:8000/api', // API基地址
  timeout: 5000, // 设置请求超时时间
});
// 用户登录
const userinfo = async (params: any) => {
  return await instance.get('/userinfo/', { params: params })
}
// 员工信息查询
const employeeSearch = async (params: any) => {
  return await instance.get('/employee_search/', { params })
}
// 员工信息更新
const employeeUpdate = async (parms: any) => {
  return await instance.post('/employee_update/', parms)
}
// 员工信息删除
const employeeDelete = async (parms: any) => {
  return await instance.post('/employee_delete/', parms)
}
// 原料检测接口
const matirialAdd = async (params: any) => {
  return await instance.post('/matirial_add/', params)
}
// 成品入库检测接口
const warehousingAdd = async (params: any) => {
  return await instance.post('/warehousing_add/', params)
}
// 成品出库
const outAdd = async (params: any) => {
  return await instance.post('/out_add/', params)
}
// 待办事项-查询
const todoSearch = async (params?: any) => {
  return await instance.get('/todo_search/', { params })
}
const todoUpdate = async (params: any) => {
  return await instance.post('/todo_update/', params)
}
// 事项汇查询
const summarySearch = async (params: any) => {
  return await instance.get('/summary_search/', { params })
}
// 事项汇总更新
const summaryUpdate = async (params: any) => {
  return await instance.post('/summary_update/', params)
}
// 事项汇总删除
const summaryDelete = async (params: any) => {
  return await instance.post('/summary_delete/', params)
}
// 个人信息查询
const userinfoSearch = async (params: any) => {
  return await instance.get('/userinfo_search/', { params })
}
// 用户信息更新
const userinfoUpdate = async (params: any) => {
  return await instance.post('/userinfo_update/', params)
}
// 用户信息更新
// const userinfoUpdate = async (params: any) => {
//   return await instance.post('/userinfo_update/', params)
// }

export {
  userinfo,
  employeeSearch,
  employeeUpdate,
  employeeDelete,
  matirialAdd,
  warehousingAdd,
  outAdd,
  todoSearch,
  summarySearch,
  summaryUpdate,
  summaryDelete,
  userinfoSearch,
  userinfoUpdate,
  todoUpdate
}